
<#--表单-->
<#macro form action method="get" id="" clazz="" enctype="" attrs=[]>
    <#local attribute = 'action="${action}" method="${method}"' />
    <#if id != "">
        <#local attribute='${attribute} id="${id}"' />
    </#if>
    <#if clazz != "">
        <#local attribute='${attribute} class="${clazz}"' />
    </#if>
    <#if enctype != "">
        <#local attribute='${attribute} enctype="${enctype}"' />
    </#if>
    <#list attrs as attr>
        <#local attribute="${attribute} ${attr}" />
    </#list>
    <#noescape>
    <form ${attribute}>
        <#nested />
    </form>
    </#noescape>
</#macro>

<#--下拉框-->
<#macro select name items id=name clazz=name style="" attrs=[]>
    <#local attribute = 'name="${name}"' />
    <#if id != "">
        <#local attribute = '${attribute} id="${id}"' />
    </#if>
    <#if clazz != "">
        <#local attribute = '${attribute} class="${clazz}"' />
    </#if>
    <#if style != "">
        <#local attribute = '${attribute} style="${style}"' />
    </#if>
    <#list attrs as attr>
        <#local attribute="${attribute} ${attr}" />
    </#list>
    <#noescape>
    <select ${attribute}>
    <#if items??>
        <#list items as item>
            <#if item.selected>
                <option value="${item.value}" selected="selected">${item.text}</option>
            <#else>
                <option value="${item.value}">${item.text}</option>
            </#if>
        </#list>
    </#if>
    </select>
    </#noescape>
</#macro>